CC = g++ -Wall -std=c++0x -fPIC
RELEASE = 1
UNICODE = 0
LOADBIN = -L /usr/local/lib/NetEngine_Release/NetEngine_HelpComponents
LIB = -lHelpComponents_DataBase
LIBEX = -static-libgcc -lrt -ldl
LOADSO = -Wl,-rpath=:./WINApt_Logic
LIBINCLUDE = LogicSql_DevRoot.o LogicSql_DllMain.o

ifeq ($(RELEASE),1)
FLAGS = -c -O2 
DEBUG = 
else
FLAGS = -c -lc_p
DEBUG = -g -pg 
endif

ifeq ($(UNICODE),1)
UNICODE = -D _UNICODE
else
UNICODE = 
endif

all:$(LIBINCLUDE)
	$(CC) $(DEBUG) $(LIBINCLUDE) -o libWINApt_LogicSql.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)

LogicSql_DevRoot.o:./LogicSql_DevRoot/LogicSql_DevRoot.cpp                 
	$(CC) $(DEBUG) $(FLAGS) $(UNICODE) ./LogicSql_DevRoot/LogicSql_DevRoot.cpp 
	
LogicSql_DllMain.o:LogicSql_DllMain.cpp             
	$(CC) $(DEBUG) $(FLAGS) $(UNICODE) LogicSql_DllMain.cpp


InstallAll:InstallSo 
InstallSo:./libWINApt_LogicSql.so 
	cp ./libWINApt_LogicSql.so ../../../WINApt_Release/WINApt_Logic/libWINApt_LogicSql.so



CleanAll:CleanObj CleanMk
CleanObj:
	rm *.o                                          
CleanMk:
	rm *.so                                        
